package chp11;

import java.util.Scanner;

public class Computer {

    String name;

    int score;

    Scanner input = new Scanner(System.in);
    public void init(){
        System.out.print("请选择对方角色(1.刘备 2.孙权 3.曹操):");
        int num = input.nextInt();
        switch (num){
            case 1:
                name = "刘备";break;
            case 2:
                name = "孙权";break;
            case 3:
                name = "曹操";break;
            default:
                name = "未知";break;
        }
    }
    public int showFist(){
        int compFist = (int) (Math.random() * 3 + 1);
        switch (compFist) {
            case 1:
                System.out.println(name + " 出拳:剪刀");
                break;
            case 2:
                System.out.println(name + " 出拳:石头");
                break;
            case 3:
                System.out.println(name + " 出拳:布");
                break;
        }
        return compFist;
    }
}
